package Errorcode

const (
	//成功
	Success = 200
	//参数错误
	ParamError = 400
	//未经授权
	NotAuth = 401
	//请求被禁止
	Forbidden = 403
	//找不到页面
	NotFound = 404
	//系统错误
	SystemError = 500
)

//状态码与错误信息的映射值
var MsgEN = map[int]string{
	Success:     "success",
	ParamError:  "param error",
	NotAuth:     "not authorized",
	Forbidden:   "forbidden",
	NotFound:    "not found",
	SystemError: "system error",
}
//传递code码获取上述MsgEN定义的错误信息值
//@reviser sam@2020-04-07 10:47:32
func GetMsg(code int) string {
	if msg, ok := MsgEN[code]; ok {
		return msg
	}
	return ""
}